Core Setup Prerequisites for Android Project
-
Create Project
- Initialize your Android project in Android Studio.
-
Add
.gitignore- Set up a
.gitignorefile to exclude unnecessary files from being tracked in version control. - Use a predefined Android
.gitignorefile to prevent committing build files, local environment settings, and other unnecessary content.
- Set up a
-
Gradle Configuration
- Configure the Gradle wrapper for the project.
- Set up essential Gradle properties like parallel builds, daemon mode, and caching for performance.
-
Build Variants and Flavors
- Define build variants (e.g.,
debug,release) and product flavors for different versions of the app. - Customize each variant/flavor based on the required configurations.
- Define build variants (e.g.,
-
Code Signing Setup
- Set up app signing with a keystore for release builds.
- Ensure that both debug and release signing configurations are defined in the
build.gradlefile.
-
External Dependencies Management
- Use Gradle or Maven repositories to manage external libraries and dependencies.
- Ensure compatibility with the required Android API levels.
-
ProGuard and R8 Setup
- For production builds, configure ProGuard or R8 to shrink, obfuscate, and optimize the code.
- Properly set up
proguard-rules.profiles to prevent stripping essential code and libraries.